while true
do

time nohup python fetch.py scan |awk 'BEGIN{10000*srand();} {printf "%s %s\n", rand(), $0}'  | sort -k1n | awk '{gsub($1FS,""); print $0}'  |xargs -n1 -P30 python fetch.py download -i &
sleep 3600
ps -FC python|grep download|awk '{print $2}'|xargs -n1 kill -9
ps -FC xargs|grep download|awk '{print $2}'|xargs -n1 kill -9

time nohup python fetch.py scan |awk 'BEGIN{10000*srand();} {printf "%s %s\n", rand(), $0}'  | sort -k1n | awk '{gsub($1FS,""); print $0}'  |xargs -n1 -P30 python fetch.py download -i &
sleep 3600
ps -FC python|grep download|awk '{print $2}'|xargs -n1 kill -9
ps -FC xargs|grep download|awk '{print $2}'|xargs -n1 kill -9

python fetch.py sync list | xargs -n1 -P3 python fetch.py sync -i
python fetch.py sync list | xargs -n1 -P3 python fetch.py sync -i
python fetch.py sync list | xargs -n1 -P3 python fetch.py sync -i
python fetch.py sync data -f4,5,6,58,27,230,143,253,249,419,77,345,229
echo `date +"%Y-%m-%d %H:%M:%S"`
done
